//
//  VideoCore.h
//  VideoDiary
//
//  Created by qianfeng on 15/9/29.
//  Copyright © 2015年 HYZ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@class VideoCore;

@protocol VideoCoreDelegate <NSObject>

@optional
- (void)videoCoreStartRecording: (VideoCore *)videoCore;
- (void)videoCoreFinishRecording: (VideoCore *)videoCore;

- (void)videoCoreFinishCropping: (VideoCore *)videoCore;

- (void)videoCoreCameraChanged: (VideoCore *)videoCore;
- (void)videoCoreCameraFailed: (VideoCore *)videoCore;

@end

@interface VideoCore : NSObject

@property (nonatomic) NSString * videoPath;
@property (nonatomic) NSString * videoTempPath;

@property (nonatomic, weak) id<VideoCoreDelegate> delegate;

- (id) initWithDelegate: (id<VideoCoreDelegate>) delegate;

- (BOOL) setCameraAtView: (UIView *)view;
- (void) startCamera;
- (void) stopCamera;

- (BOOL) startRecordToPath: (NSString *)path;
- (void) stopRecord;

- (BOOL) isRecording;

- (void) changeCamera;

- (void) cropVideo;
- (void) flipVideo;

@end
